package com.baiyang.server.model.system;

import java.util.List;

import com.baiyang.server.annotation.NotNull;


@NotNull
public abstract class Tree <T>{
	@NotNull(value = "id不能为空")
	private String id;
	@NotNull(value = "parentId不能为空")
	private String parentId;
	private List<T> childrens;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getParentId() {
		return parentId;
	}
	public void setParentId(String parentId) {
		this.parentId = parentId;
	}
	public List<T> getChildrens() {
		return childrens;
	}
	public void setChildrens(List<T> childrens) {
		this.childrens = childrens;
	}
	public void setChildren(T children) {
		this.childrens.add(children);
	}
	/**
	 * 排序方法
	 */
	public abstract void sorted();
}
